package com.liqi.info.service.impl;

import java.util.List;
import com.liqi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.liqi.info.mapper.TInfoNoticeMapper;
import com.liqi.info.domain.TInfoNotice;
import com.liqi.info.service.ITInfoNoticeService;

/**
 * 通知Service业务层处理
 * 
 * @author xiaoli
 * @date 2022-11-19
 */
@Service
public class TInfoNoticeServiceImpl implements ITInfoNoticeService 
{
    @Autowired
    private TInfoNoticeMapper tInfoNoticeMapper;

    /**
     * 查询通知
     * 
     * @param id 通知主键
     * @return 通知
     */
    @Override
    public TInfoNotice selectTInfoNoticeById(Long id)
    {
        return tInfoNoticeMapper.selectTInfoNoticeById(id);
    }

    /**
     * 查询通知列表
     * 
     * @param tInfoNotice 通知
     * @return 通知
     */
    @Override
    public List<TInfoNotice> selectTInfoNoticeList(TInfoNotice tInfoNotice)
    {
        return tInfoNoticeMapper.selectTInfoNoticeList(tInfoNotice);
    }

    /**
     * 新增通知
     * 
     * @param tInfoNotice 通知
     * @return 结果
     */
    @Override
    public int insertTInfoNotice(TInfoNotice tInfoNotice)
    {
        tInfoNotice.setCreateTime(DateUtils.getNowDate());
        tInfoNotice.setUpdateTime(DateUtils.getNowDate());
        tInfoNotice.setStatus(0);
        return tInfoNoticeMapper.insertTInfoNotice(tInfoNotice);
    }

    /**
     * 修改通知
     * 
     * @param tInfoNotice 通知
     * @return 结果
     */
    @Override
    public int updateTInfoNotice(TInfoNotice tInfoNotice)
    {
        tInfoNotice.setUpdateTime(DateUtils.getNowDate());
        return tInfoNoticeMapper.updateTInfoNotice(tInfoNotice);
    }

    /**
     * 批量删除通知
     * 
     * @param ids 需要删除的通知主键
     * @return 结果
     */
    @Override
    public int deleteTInfoNoticeByIds(Long[] ids)
    {
        return tInfoNoticeMapper.deleteTInfoNoticeByIds(ids);
    }

    /**
     * 删除通知信息
     * 
     * @param id 通知主键
     * @return 结果
     */
    @Override
    public int deleteTInfoNoticeById(Long id)
    {
        return tInfoNoticeMapper.deleteTInfoNoticeById(id);
    }
}
